home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / DHTML - Menus / static-menu.izs < prev    next >
Text File  |  2005-09-02  |  8KB  |  216 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Static Menu Script
  4. <!/TITLE>
  5.  
  6. <!BROWSER>NS6+ IE5+ Opera 7+<!/BROWSER>
  7.  
  8. <!DESCRIPTION> Add an elegant, visible-from-the-start static menu to your site with this script! Both the menu's dimensions and its static location on the page can be easily configured, making it a piece of cake to integrate the menu to conform to your site's layout. Definitely one of the better DHTML menu systems out there.
  9. <!/DESCRIPTION> 
  10.  
  11. <!CATEGORY>drop down menus<!/CATEGORY>
  12.  
  13. <!SCRIPT>
  14. <!-- START OF SCRIPT -->
  15. <!-- Step 1: Insert the following stylesheet into the <head> section of your page: -->
  16. <STYLE TYPE="text/css">
  17. <!--
  18.  
  19. .menuh    {
  20.         BORDER-COLOR : #FFFF99 ;
  21.         cursor : hand ;
  22.         Border-Left : #FFFF99 ;
  23.         Border-Top : #FFFF99 ;
  24.         Padding-Left : 1px ;
  25.         Padding-Top : 1px ;
  26.         Background-Color : #FFFF99 ;
  27.     }
  28. .menu    {
  29.         Background-Color : white ;
  30.     }
  31. .home    {
  32.         cursor : hand ;
  33.     }
  34.  
  35. .menulinks{
  36. text-decoration:none;
  37. }
  38. //-->
  39. </STYLE>
  40. <!-- Step 2: Insert the following into the <body> section of your page, outside any other tags: -->
  41. <SCRIPT Language="Javascript1.2">
  42. <!--
  43.  
  44. /*
  45. Static menu script (By maXimus, maximus@nsimail.com, http://maximus.ravecore.com/)
  46. Modified slightly/ permission granted to Dynamic Drive to feature script in archive
  47. For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
  48. */
  49.  
  50. //configure below variable for menu width, position on page
  51. var menuwidth=110
  52. var offsetleft=10
  53. var offsettop=90
  54.  
  55. var ns4=document.layers?1:0
  56. var ie4=document.all?1:0
  57. var ns6=document.getElementById&&!document.all?1:0
  58.  
  59. function makeStatic() {
  60. if (ie4) {object1.style.pixelTop=document.body.scrollTop+offsettop}
  61. else if (ns6) {document.getElementById("object1").style.top=window.pageYOffset+offsettop}
  62. else if (ns4) {eval(document.object1.top=eval(window.pageYOffset+offsettop));}
  63. setTimeout("makeStatic()",0);
  64. }
  65.  
  66. if (ie4||ns6) {document.write('<span ALIGN="CENTER" ID="object1" STYLE="Position:absolute; Top:20; Left:'+offsetleft+'; Z-Index:5;cursor:hand;background-color:black;"><TABLE BORDER="1" width="'+menuwidth+'" CELLPADDING="0" CELLSPACING="0" BORDERCOLOR="black" bgcolor="white">')}
  67. else if (ns4){ document.write('<LAYER top="20" name="object1" left="'+offsetleft+'" BGCOLOR=black><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="1"><TR><TD><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" width="'+menuwidth+'">')}
  68.  
  69. if (ie4||ns6||ns4)
  70. document.write('<TR><TD BGCOLOR="#3399FF" BORDERCOLORDARK="#99CCFF" BORDERCOLORLIGHT="#003399"><P ALIGN=CENTER><FONT SIZE="4" FACE=ARIAL>Menu</FONT></TD></TR>')
  71.  
  72. var menui = new Array();
  73. var menul = new Array();
  74.  
  75. //configure below for menu items. Extend list as desired
  76.  
  77. menui[0]="Dynamic Drive";
  78. menui[1]="What\'s New?";
  79. menui[2]="What\'s Hot?";
  80. menui[3]="Message Forum";
  81. menui[4]="FAQs";
  82. menui[5]="Submit Script";
  83. menui[6]="Link to us";
  84. menui[7]="Email us";
  85.  
  86. menul[0]="http://dynamicdrive.com";
  87. menul[1]="http://dynamicdrive.com/new.htm";
  88. menul[2]="http://dynamicdrive.com/hot.htm";
  89. menul[3]="http://wsabstract.com/cgi-bin/Ultimate.cgi";
  90. menul[4]="http://dynamicdrive.com/faqs.htm";
  91. menul[5]="http://dynamicdrive.com/submit.htm";
  92. menul[6]="http://dynamicdrive.com/link.htm";
  93. menul[7]="http://dynamicdrive.com/contact.htm";
  94.  
  95. for (i=0;i<=menui.length-1;i++)
  96. if (ie4||ns6) {document.write('<TR><TD BORDERCOLOR="white" ONCLICK="location=\''+menul[i]+'\'" onmouseover="className=\'menuh\'" onMouseout="className=\'menu\'"><CENTER><FONT>'+menui[i]+'</FONT></TD></TR>')}
  97. else if (ns4){document.write('<TR><TD BGCOLOR="white"><ILAYER><LAYER width="'+menuwidth+'" onmouseover="bgColor=\'yellow\'" onmouseout="bgColor=\'white\'"><CENTER><A HREF="'+menul[i]+'" class=menulinks>'+menui[i]+'</A></CENTER></LAYER></ILAYER></TD></TR>')}
  98.  
  99. if (ie4||ns6) {document.write('</TABLE></span>')}
  100. else if (ns4){document.write('</TABLE></TD></TR></TABLE></LAYER>')}
  101.  
  102. function menu3(){
  103. if (ns6||ie4||ns4)
  104. makeStatic()
  105. }
  106.  
  107. window.onload=menu3
  108.  
  109. //-->
  110. </SCRIPT>
  111. <!-- END OF SCRIPT -->
  112. <!/SCRIPT>
  113.  
  114. <!PREVIEW>
  115. <!-- START OF SCRIPT -->
  116.  
  117. <!-- Step 1: Insert the following stylesheet into the <head> section of your page: -->
  118. <STYLE TYPE="text/css">
  119. <!--
  120.  
  121. .menuh    {
  122.         BORDER-COLOR : #FFFF99 ;
  123.         cursor : hand ;
  124.         Border-Left : #FFFF99 ;
  125.         Border-Top : #FFFF99 ;
  126.         Padding-Left : 1px ;
  127.         Padding-Top : 1px ;
  128.         Background-Color : #FFFF99 ;
  129.     }
  130. .menu    {
  131.         Background-Color : white ;
  132.     }
  133. .home    {
  134.         cursor : hand ;
  135.     }
  136.  
  137. .menulinks{
  138. text-decoration:none;
  139. }
  140. //-->
  141. </STYLE>
  142. <!-- Step 2: Insert the following into the <body> section of your page, outside any other tags: -->
  143. <SCRIPT Language="Javascript1.2">
  144. <!--
  145.  
  146. /*
  147. Static menu script (By maXimus, maximus@nsimail.com, http://maximus.ravecore.com/)
  148. Modified slightly/ permission granted to Dynamic Drive to feature script in archive
  149. For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
  150. */
  151.  
  152. //configure below variable for menu width, position on page
  153. var menuwidth=110
  154. var offsetleft=10
  155. var offsettop=90
  156.  
  157. var ns4=document.layers?1:0
  158. var ie4=document.all?1:0
  159. var ns6=document.getElementById&&!document.all?1:0
  160.  
  161. function makeStatic() {
  162. if (ie4) {object1.style.pixelTop=document.body.scrollTop+offsettop}
  163. else if (ns6) {document.getElementById("object1").style.top=window.pageYOffset+offsettop}
  164. else if (ns4) {eval(document.object1.top=eval(window.pageYOffset+offsettop));}
  165. setTimeout("makeStatic()",0);
  166. }
  167.  
  168. if (ie4||ns6) {document.write('<span ALIGN="CENTER" ID="object1" STYLE="Position:absolute; Top:20; Left:'+offsetleft+'; Z-Index:5;cursor:hand;background-color:black;"><TABLE BORDER="1" width="'+menuwidth+'" CELLPADDING="0" CELLSPACING="0" BORDERCOLOR="black" bgcolor="white">')}
  169. else if (ns4){ document.write('<LAYER top="20" name="object1" left="'+offsetleft+'" BGCOLOR=black><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="1"><TR><TD><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" width="'+menuwidth+'">')}
  170.  
  171. if (ie4||ns6||ns4)
  172. document.write('<TR><TD BGCOLOR="#3399FF" BORDERCOLORDARK="#99CCFF" BORDERCOLORLIGHT="#003399"><P ALIGN=CENTER><FONT SIZE="4" FACE=ARIAL>Menu</FONT></TD></TR>')
  173.  
  174. var menui = new Array();
  175. var menul = new Array();
  176.  
  177. //configure below for menu items. Extend list as desired
  178.  
  179. menui[0]="Dynamic Drive";
  180. menui[1]="What\'s New?";
  181. menui[2]="What\'s Hot?";
  182. menui[3]="Message Forum";
  183. menui[4]="FAQs";
  184. menui[5]="Submit Script";
  185. menui[6]="Link to us";
  186. menui[7]="Email us";
  187.  
  188. menul[0]="http://dynamicdrive.com";
  189. menul[1]="http://dynamicdrive.com/new.htm";
  190. menul[2]="http://dynamicdrive.com/hot.htm";
  191. menul[3]="http://wsabstract.com/cgi-bin/Ultimate.cgi";
  192. menul[4]="http://dynamicdrive.com/faqs.htm";
  193. menul[5]="http://dynamicdrive.com/submit.htm";
  194. menul[6]="http://dynamicdrive.com/link.htm";
  195. menul[7]="http://dynamicdrive.com/contact.htm";
  196.  
  197. for (i=0;i<=menui.length-1;i++)
  198. if (ie4||ns6) {document.write('<TR><TD BORDERCOLOR="white" ONCLICK="location=\''+menul[i]+'\'" onmouseover="className=\'menuh\'" onMouseout="className=\'menu\'"><CENTER><FONT>'+menui[i]+'</FONT></TD></TR>')}
  199. else if (ns4){document.write('<TR><TD BGCOLOR="white"><ILAYER><LAYER width="'+menuwidth+'" onmouseover="bgColor=\'yellow\'" onmouseout="bgColor=\'white\'"><CENTER><A HREF="'+menul[i]+'" class=menulinks>'+menui[i]+'</A></CENTER></LAYER></ILAYER></TD></TR>')}
  200.  
  201. if (ie4||ns6) {document.write('</TABLE></span>')}
  202. else if (ns4){document.write('</TABLE></TD></TR></TABLE></LAYER>')}
  203.  
  204. function menu3(){
  205. if (ns6||ie4||ns4)
  206. makeStatic()
  207. }
  208.  
  209. window.onload=menu3
  210.  
  211. //-->
  212. </SCRIPT>
  213. <!-- END OF SCRIPT -->
  214. <!/PREVIEW>
  215.  
  216. <!RELATED>NONE<!/RELATED>